<?php
class User
{	//公共变量
	public $name;
	public $age;
	public $sex;
	//公共方法
	public function __construct($name,$age,$sex)
	{	//把变量$name 赋值给当前对象的name值
		$this->name=$name;
		//$age 赋值给了当前的age
		$this->age=$age;
		//$sex 赋值给了当前的 sex
		$this->sex=$sex;
	}
	function add()
	{
		echo 'add user:'.
		$this->name.$this->age.$this->sex;
	}
	function edit()
	{
		echo 'edit user:'.
		$this->name.$this->age.$this->sex;
	}
}
// 创建实体对象
$obj = new User('lisi',34,'boy');

$obj->edit();


